package scyReport

import (
	"github.com/gin-gonic/gin"
	"likeadmin/clog"
	"likeadmin/dbc"
	"likeadmin/model"
	"likeadmin/sqlop"
	"likeadmin/webu"
	"time"
)

func CreateScyReport(c *gin.Context) {
	scyReport := &model.ScyReport{}
	c.ShouldBind(scyReport)
	scyReport.CreateTime = time.Now().Unix()
	clog.Info("scyReport,CreateScyReport,scyReport=", scyReport)
	err := dbc.DB.Create(scyReport).Error
	webu.GinResult("CreateScyReport Error:", c, err)
}

func UpdateScyReport(c *gin.Context) {
	/*	scyReport := &model.ScyReport{}
		c.ShouldBind(scyReport)
		clog.Info("scyReport,UpdateScyReport,scyReport=", scyReport)
		err := sqlop.ExecFourP("update scy_report set scy_report_name=?,scy_report_introduction=?,update_time=? where id=?", scyReport.ScyReportName, scyReport.ScyReportIntroduction, time.Now().Unix(), scyReport.Id)
		webu.GinResult("UpdateScyReport Error:", c, err)*/

}

func DeleteScyReport(c *gin.Context) {
	scyReport := &model.ScyReport{}
	c.ShouldBind(scyReport)
	clog.Info("scyReport,DeleteScyReport,scyReport=", scyReport)
	err := sqlop.ExecTwoP("update scy_report set is_deleted=1,delete_time=? where id=?", time.Now().Unix(), scyReport.Id)
	webu.GinResult("DeleteScyReport Error:", c, err)
}
